﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title></title>
<script type="text/javascript" src="../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../_libs/jquery.jtemplates.js"></script>
<script type="text/javascript" src="../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../style/global.css" />
<script type="text/javascript" src="../../admin/otherpage/styles/common.js"></script>
<link type="text/css" rel="stylesheet" href="../../admin/otherpage/styles/common.css" />
<script type="text/javascript">


    var pagesize = 15;
    var pid = joinValue('pid');
var page=thispage();
$(document).ready(function(){
	ajaxList(page);

});
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+pid+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=ajaxGetList",
        error:		function(XmlHttpRequest,textStatus, errorThrown) { alert(XmlHttpRequest.responseText);},
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: true});
				$("#ajaxList").processTemplate(d);
				ActiveCoolTable();
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function operater(act,groupid){
	var ids = JoinSelect("selectID");
	if(ids=="")
	{
		top.JumbotCms.Alert("没有任何选择项", "0"); 
		return;
	}
	top.JumbotCms.Loading.show("正在处理...");
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"ids="+ids+"&togid="+groupid,
		url:		"ajax.aspx?oper=ajaxBatchOper&act="+act+"&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Loading.hide();
				ajaxList(page);
				break;
			}
		}
	});
}
function ConfirmDel(id){
	top.top.JumbotCms.Confirm(site.UserItem+"删除后，与其相关的信息都将删除并不可复原，确定吗?", "IframeOper.ajaxDel("+id+")");
}
function ajaxDel(id){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"ajax.aspx?oper=ajaxDel&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxAdd(){
    top.JumbotCms.Popup.show('edit.aspx?id=0'+pid, -1,-1, true);
}
</script>
</head>
<body>
<textarea id="tplTopNav" style="display:none">
<div class="topnav"> <span class="preload1"></span><span class="preload2"></span>
	<ul id="topnavbar">
	<li class="topmenu"><a href="javascript:void(0);" onclick="ajaxAdd()" class="top_link"><span>添加信息</span></a>
		
		 </li>
		<li class="topmenu"><a href="javascript:void(0);" onclick="ajaxList(1)" id="A1" class="top_link"><span>刷新</span></a>
		
	</ul>
	<script>
	topnavbarStuHover();
        </script>
</div>
</textarea>
    <div id="ajaxTopNav"><div class="topnav"> <span class="preload1"></span><span class="preload2"></span>
	<ul id="topnavbar">
	<li class="topmenu"><a href="javascript:void(0);" onclick="ajaxAdd()" class="top_link"><span>添加信息</span></a>
		
		 </li>
		<li class="topmenu"><a href="javascript:void(0);" onclick="ajaxList(1)" id="A2" class="top_link"><span>刷新</span></a></li>
		
	</ul>
</div></div>
#foreach($u in $TableInfos)
#beforeall
#each
<textarea id="tplList" style="display:none">
<table class="cooltable">
<thead>
	<tr>
		<th align="center" scope="col" style="width:30px;"><input onclick="checkAllLine()" id="checkedAll" name="checkedAll" type="checkbox" /></th>
#foreach($c in $u.ColumnInfos)
		<th scope="col" style="width:60px;">$c.DeText</th>
#end
		<th scope="col" >操作</th>
	</tr>
</thead>
<tbody>
{foreach T.table as record}
	<tr>
		<td align="center"><input class="checkbox" name="selectID" type="checkbox" value='{$T.record.id}' /></td>
#foreach($c in $u.ColumnInfos)
		<td align="center">{$T.record.${c.ColumnName}}</td>
#end
#end
		<td align="center" class="oper">
<a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show('edit.aspx?id={$T.record.id}',-1,-1,true)">修改</a>
			<a href="javascript:void(0);" onclick="ajaxDel({$T.record.id})">删除</a>
		</td>
	</tr>
	{#/for}
</tbody>
</table>
</textarea>
    <div id="ajaxList"></div>
    <div id="ajaxPageBar" class="pages"></div>
</body>
</html>
